package com.yungu.swift.assets.driver.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yungu.swift.base.model.BaseDto;
import com.yungu.swift.base.model.annotation.AbsoluteImgPath;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


/**
 * Copyright © 厦门云谷互联信息有限公司 2018-2020 All Right Reserved
 * <p>
 * 司机申请DTO
 *
 * @author Zerrion
 * @version 1.0.0-RELEASE
 * @since 2018-07-05 17:57
 */
@Data
public class DriverChangeCarDto extends BaseDto {

    /**
     * 审核状态码 1：待处理 2：通过 3：驳回
     */
    public static final int STATUS_PENDING = 1;
    public static final int STATUS_PASS = 2;
    public static final int STATUS_REJECT = 3;

    /**
     * 代理uuid
     */
    private String driverUuid;

    /**
     * 代理uuid
     */
    private String agentUuid;

    /**
     * 代理名称
     */
    private String agentName;

    /**
     * 公司uuid
     */
    private String companyUuid;

    /**
     * 公司名称
     */
    private String companyName;

    /**
     * 驾驶证正面照片地址
     */
    @AbsoluteImgPath
    private String drivingLicenceHomeImg;

    /**
     * 驾驶证反面照片地址
     */
    @AbsoluteImgPath
    private String drivingLicenceSubImg;

    /**
     * 业务类型（1：出租车、2：专车、3：跨城拼车、4：快车）
     */
    private Integer businessType;

    /**
     * 业务类型名称
     */
    private String businessName;

    /**
     * 车牌号
     */
    private String plateNum;

    /**
     * 车辆颜色
     */
    private String carColor;

    /**
     * 车辆品牌
     */
    private String brand;

    /**
     * 车辆型号
     */
    private String model;

    /**
     * 车身45°角照片
     */
    @AbsoluteImgPath
    private String carAngle45Img;

    /**
     * 人车合影
     */
    @AbsoluteImgPath
    private String mancarImg;

    /**
     * 备注
     */
    private String remark;

    /**
     * 状态（1：待审核、2：审核通过、3：审核失败）
     */
    private Integer status;

    /**
     * 所属车型uuid
     */
    private String carModelUuid;

    /**
     * 更新状态
     */
    private Integer updateStatus;

    /**
     * 能源类型
     */
    private Integer energyType;

    /**
     * 能源类型
     */
    private Integer isNotice;

    /**
     * 司机姓名
     */
    private String driverName;

    /**
     * 司机电话
     */
    private String mobile;

    /**
     * 省份证号
     */
    private String idCard;

    /**
     * 车辆注册日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date carRegisteredTime;

    public DriverChangeCarDto() {
    }

    public DriverChangeCarDto(DriverDto driverDto, CarDto carDto) {
        this.driverUuid = driverDto.getUuid();
        this.agentUuid = driverDto.getAgentUuid();
        this.agentName = driverDto.getAgentName();
        this.companyUuid = driverDto.getCompanyUuid();
        this.companyName = driverDto.getCompanyName();
        this.drivingLicenceHomeImg = carDto.getDrivingLicenseImg();
        this.drivingLicenceSubImg = carDto.getDrivingLicenseSubImg();
        this.businessType = driverDto.getBusinessType();
        this.businessName = driverDto.getBusinessType() == 2 ? "专车" : driverDto.getBusinessType() == 4 ? "快车" : "";
        this.plateNum = carDto.getPlateNum();
        this.carColor = carDto.getCarColor();
        this.brand = carDto.getBrand();
        this.model = carDto.getModel();
        this.carAngle45Img = carDto.getCarAngle45Img();
        this.mancarImg = carDto.getManCarImg();
        this.carModelUuid = carDto.getCarModelUuid();
        this.carRegisteredTime = driverDto.getGetDriverLicenseDate();
    }

    public DriverChangeCarDto(String driverUuid, String agentUuid, String agentName, String companyUuid, String companyName, String drivingLicenceHomeImg, String drivingLicenceSubImg, Integer businessType, String businessName, String plateNum, String carColor, String brand, String model, String carAngle45Img, String mancarImg, String remark, Integer status, String carModelUuid, Integer updateStatus, Integer energyType, Integer isNotice, String driverName, String mobile, String idCard,Date carRegisteredTime) {
        this.driverUuid = driverUuid;
        this.agentUuid = agentUuid;
        this.agentName = agentName;
        this.companyUuid = companyUuid;
        this.companyName = companyName;
        this.drivingLicenceHomeImg = drivingLicenceHomeImg;
        this.drivingLicenceSubImg = drivingLicenceSubImg;
        this.businessType = businessType;
        this.businessName = businessName;
        this.plateNum = plateNum;
        this.carColor = carColor;
        this.brand = brand;
        this.model = model;
        this.carAngle45Img = carAngle45Img;
        this.mancarImg = mancarImg;
        this.remark = remark;
        this.status = status;
        this.carModelUuid = carModelUuid;
        this.updateStatus = updateStatus;
        this.energyType = energyType;
        this.isNotice = isNotice;
        this.driverName = driverName;
        this.mobile = mobile;
        this.idCard = idCard;
        this.carRegisteredTime = carRegisteredTime;
    }
}
